package com.my.service;

import com.my.spring.*;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/6/14 20:43
 */
@Component("userService")
@Scope("singleton")
public class UserService implements BeanNameAware, InitializingBean, UserInterface {
    
    // userService->推断构造方法(默认是无参的)->依赖注入->属性设置好后->afterProperties()->
    // 初始化后AOP->生成代理对象->放入一级缓存中Map<beanName, bean对象>->单例池
    @Autowired
    private OrderService orderService;
    
    private String beanName;
    
    private String xxx;
    
    public void test() {
        System.out.println(orderService);
    }

    
    
    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterProperties() {
        System.out.println("初始化方法调用---->属性设置完后调用");
    }
}
